<%@page import="org.apache.catalina.connector.Request"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<jsp:useBean id="preds" type="com.predictions.Predictions" class="com.predictions.Predictions">
		<%
			//检查HTTP动词：如果它是除了GET以外的任何东西
			//则返回405（不支持的方法）
			String verb=request.getMethod();
			if(!verb.equalsIgnoreCase("GET")){
				response.sendError(response.SC_METHOD_NOT_ALLOWED, "Only GET requests are allowed.");
			}
			//如果它是一个GET请求，则返回预测
			else{
				preds.setSctx(application);
				out.println(preds.getPredictions());
			}
		%>
	</jsp:useBean>
</body>
</html>